/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package tetris.model.spel;

import java.awt.Dimension;
import java.awt.GridLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JButton;
import javax.swing.JPanel;
import tetris.model.blokken.Bord;
import tetris.view.HoofdPaneel;

/**
 *
 * @author Pieter Hens
 */
public class KnoppenPaneel extends JPanel {

    
    
    private JButton quit;
    private JButton pauze;
    private Bord bord;
    private SpeelTijd klok;
    private HoofdPaneel hoofdpaneel;
    
    public KnoppenPaneel (SpeelTijd tijd) {
        setLayout(new GridLayout(2,1,0,10));
        setPreferredSize(new Dimension(140,100));
        klok = tijd;
        quit = new JButton("Quit");
        quit.addActionListener(new ActionListener() {

            public void actionPerformed(ActionEvent e) {
                throw new UnsupportedOperationException("Not supported yet.");
            }
        });
        pauze = new JButton("pauze");
        pauze.addActionListener(new ActionListener() {

            public void actionPerformed(ActionEvent e) {
                bord.pauze();
                klok.pauze();
                hoofdpaneel.requestFocus();
                
            }
        });
        add(quit);
        add(pauze);
    }
    
    public  void setBord(Bord bord) {
        this.bord = bord;
    }

    public void setHoofdpaneel(HoofdPaneel hoofdframe) {
        hoofdpaneel = hoofdframe;
    }

}
